Skip to content

fix(i18n): shorten language switcher + localize scenario badges#22

Merged
oratis merged 1 commit into
mainfrom
claude/nice-mcclintock-e1cb00
Jun 16, 2026
Merged

fix(i18n): shorten language switcher + localize scenario badges#22
oratis merged 1 commit into
mainfrom
claude/nice-mcclintock-e1cb00

Conversation

@oratis

@oratis oratis commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

Two UI/i18n fixes on the agent marketplace.

1. Shorter language switcher. The header pill grew with the active locale's native name (worst case "Bahasa Indonesia", ~190px). It now shows a compact uppercase code (EN/ZH/…) at a fixed ~81px, via a transparent native <select> overlay that keeps full keyboard/screen-reader accessibility and still shows the complete native names in the dropdown.

2. Localized scenario badges. Agent cards hardcoded the Chinese nameZh, so badges read "Agent框架 / 运维自动化 / 编程开发" even on the English UI. They now use the next-intl Scenarios namespace, matching the home tiles, /agents filter chips, and detail page. The admin display chip got the same fix (its bilingual editor option label is intentionally left bilingual).

The 15-locale message catalogs were already complete (check:i18n passes) — the gap was components bypassing i18n.

Page Before (hardcoded) After (locale-driven)
/agents (English) Agent框架 / 运维自动化 / 编程开发 Agent Frameworks / DevOps & Automation / Coding & Dev
/zh/agents (中文) 运维自动化 / 编程开发 DevOps 与自动化 / 编程与开发 (now consistent with the filter chips)

Verification

  • tsc --noEmit: 0 errors · ESLint: changed files clean · check:i18n: all 15 locales match
  • Ran the app: switcher compact at EN/ID/ZH with full native names in the menu; /agents badges English, /zh/agents badges Chinese and consistent with the filter chips

Notes

  • DB-sourced strings (category names, descriptions) remain un-localized — that's data translation, out of scope here.
  • Pre-existing set-state-in-effect ESLint warning in admin/agents is untouched.

🤖 Generated with Claude Code

The switcher showed the active locale's full native name (e.g.
"Bahasa Indonesia"), making the header pill very wide. Render a compact
uppercase code (EN/ZH/…) with a transparent native <select> overlaid, so
the chip stays narrow and fixed-width while keyboard/screen-reader a11y
and the full native names in the option list are preserved.

Agent cards rendered scenario badges from the hardcoded `nameZh`, so they
showed Chinese regardless of UI locale. Render them via the next-intl
`Scenarios` namespace instead (matching the home tiles, /agents filter
chips, and detail page). Same fix for the admin display chip; the admin
editor's intentional bilingual option label is left as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit ffb5732 into main Jun 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant